package com.shark.uh.enums;

/**
 * Enum to represent database fields of the `user` table.
 */
public enum UserTableFields {

    ID("id", "用户id"),
    USERNAME("username", "用户名"),
    NICKNAME("nickname","昵称"),
    PASSWORD("password", "密码"),
    SALT("salt","盐值"),
    EMAIL("email", "邮箱"),
    PHONE("phone", "电话"),
    GENDER("gender", "性别"),
    PROFESSION("profession", "职业"),
    EDUCATION("education", "学历"),
    AGE("age", "年龄"),
    REMARK("remark", "备注"),
    NAME("name", "用户姓名"),
    ID_CARD("id_card", "身份证"),
    AVATAR_URL("avatar_url", "头像地址"),
    CREATED_TIME("created_time", "创建时间"),
    UPDATED_TIME("updated_time", "变更时间"),
    STATUS("status", "账号状态");

    private final String fieldName;
    private final String comment;

    /**
     * Constructor for the enum.
     *
     * @param fieldName The field name in the database.
     * @param comment   The comment or description of the field.
     */
    UserTableFields(String fieldName, String comment) {
        this.fieldName = fieldName;
        this.comment = comment;
    }

    /**
     * Gets the database field name.
     *
     * @return The field name.
     */
    public String getFieldName() {
        return fieldName;
    }

    /**
     * Gets the comment or description of the field.
     *
     * @return The comment.
     */
    public String getComment() {
        return comment;
    }

    @Override
    public String toString() {
        return fieldName + " (" + comment + ")";
    }
}